﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace Termites.Behaviors
{
    class ReverseMovementBehavior : Behavior
    {

        public override void move(GameTime gameTime, KeyboardState keyboardState, ref float direction, ref Vector2 position)
        {
            if (keyboardState.IsKeyDown(Keys.Right))
            {
                direction = Termite.RIGHT;
                position.X -= Termite.SPEED * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            else if (keyboardState.IsKeyDown(Keys.Left))
            {
                direction = Termite.LEFT;
                position.X += Termite.SPEED * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            else if (keyboardState.IsKeyDown(Keys.Up))
            {
                direction = Termite.UP;
                position.Y += Termite.SPEED * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
            else if (keyboardState.IsKeyDown(Keys.Down))
            {
                direction = Termite.DOWN;
                position.Y -= Termite.SPEED * (float)gameTime.ElapsedGameTime.TotalSeconds;
            }
        }
    }
}
